package day0115;

import java.util.Scanner;

public class Test2 {
    public static void main(String[] args) {
        int num1=(int)(Math.random()*100);//  0----99

        Scanner sc = new Scanner(System.in);
        while (true){
            System.out.println("请输入一个数字：");
            //1.
            int num2=sc.nextInt();
            if(num2 == -1){
                System.out.println("用户不想玩了，即将退出程序");
                break;
            }//2.
            if (num1==num2){
                System.out.println("恭喜你猜中了");
                break;
            }else if (num1>num2){
                System.out.println("你猜小了");
            }else {
                System.out.println("你猜大了");
            }
            //3.

        }
    }
}

